<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var obj = {
            a: 1,
            b: 2,
            c: 3
        }
        // obj.a = 2
        // obj.b = 3
        // obj.c = 4
        with (obj) {
            a = 3
            b = 4
            c = 5
        }
        console.log(obj); // 成功修改
    </script>
</body>

</html>